package com.leyou.user.service.service;

import com.leyou.common.bean.PageResult;
import com.leyou.common.bean.Result;
import com.leyou.user.inter.dto.*;
import com.leyou.user.inter.pojo.Role;
import com.leyou.user.inter.pojo.User;
import com.leyou.user.inter.vo.UserPageVO;

import java.util.List;

/**
 * @author zqq
 * @ClassName UserService
 * @Description
 * @date 2020/3/4-16:37
 */
public interface UserService {

    /**
     * @Title: checkData
     * @Description: 检查用户是否可用
     * @author: zqq
     * @param data 要校验的数据
     * @param type 要校验的数据类型：1，用户名；2，手机
     * @return: com.leyou.common.bean.Result<java.lang.Boolean>
     * @createTime: 2020-03-09 15:06
     * @version: v.1.0
     */
    Result<Boolean> checkData(String data, Integer type);

    /**
     * @Title: sendVerifyCode
     * @Description: 发送手机验证码
     * @author: zqq
     * @param phone 手机号
     * @param type 类型
     * @return: com.leyou.common.bean.Result<java.lang.Boolean>
     * @createTime: 2020-03-09 16:07
     * @version: v.1.0
     */
    Result<Boolean> sendVerifyCode(String phone,Integer type);

    /**
     * @Title: register
     * @Description: 用户注册
     * @author: zqq
     * @param dto 参数类
     * @return: com.leyou.common.bean.Result<java.lang.Boolean>
     * @createTime: 2020-03-09 16:57
     * @version: v.1.0
     */
    Result<Boolean> register(UserRegisterDTO dto);

    /**
     * @Title: queryUser
     * @Description: 根据用户名和密码查询用户
     * @author: zqq
     * @param dto 登录参数
     * @return: com.leyou.common.bean.Result<com.leyou.user.inter.pojo.User>
     * @createTime: 2020-03-09 17:27
     * @version: v.1.0
     */
    Result<User> queryUser(UserLoginDTO dto);


    /**
     * @Title: queryUserByPage
     * @Description: 分页查询用户信息
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result<com.leyou.common.bean.PageResult<com.leyou.user.inter.vo.UserPageVO>>
     * @createTime: 2020-03-25 18:52
     * @version: v.1.0
     */
    Result<PageResult<UserPageVO>> queryUserByPage(UserPageDTO dto);

    /**
     * @Title: addUser
     * @Description: 后台添加用户
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-30 11:28
     * @version: v.1.0
     */
    Result addUser(UserAddDto dto);

    /**
     * @Title: deleteUser
     * @Description: 删除和恢复用户
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-30 11:59
     * @version: v.1.0
     */
    Result deleteUser(UserUpdateDTO dto);

    /**
     * @Title: lockedUser
     * @Description: 锁定或解锁用户
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-30 11:59
     * @version: v.1.0
     */
    Result lockedUser(UserUpdateDTO dto);

    /**
     * @Title: resetUser
     * @Description: 重置用户密码
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-30 11:59
     * @version: v.1.0
     */
    Result resetUser(UserUpdateDTO dto);

    /**
     * @Title: updateUserAndRole
     * @Description: 修改用户角色
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-03-30 12:00
     * @version: v.1.0
     */
    Result updateUserAndRole(UserUpdateDTO dto);

    /**
     * @Title: queryUserInfo
     * @Description: 登录成功获取用户信息
     * @author: zqq
     * @param
     * @return: com.leyou.common.bean.Result<com.leyou.user.inter.dto.UpdateMyInfo>
     * @createTime: 2020-04-01 12:50
     * @version: v.1.0
     */
    Result<UpdateMyInfo> queryUserInfo();

    /**
     * @Title: updateMyInfo
     * @Description: 用户信息修改
     * @author: zqq
     * @param dto
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-04-01 13:52
     * @version: v.1.0
     */
    Result updateMyInfo(UpdateMyInfo dto);

    /**
     * @Title: sendOldSMS
     * @Description: 绑定手机，发送验证码
     * @author: zqq
     * @param
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-04-05 10:24
     * @version: v.1.0
     */
    Result sendOldSMS();

    /**
     * @Title: verifyOldCode
     * @Description: 绑定手机，验证短信验证码
     * @author: zqq
     * @param
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-04-05 10:24
     * @version: v.1.0
     */
    Result verifyOldCode(String code);

    /**
     * @Title: sendNewSMS
     * @Description: 绑定手机，绑定手机号发送验证码
     * @author: zqq
     * @param
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-04-05 10:24
     * @version: v.1.0
     */
    Result sendNewSMS(String phone);

    /**
     * @Title: verifyNewCode
     * @Description: 绑定手机，绑定手机号验证码验证
     * @author: zqq
     * @param
     * @return: com.leyou.common.bean.Result
     * @createTime: 2020-04-05 10:24
     * @version: v.1.0
     */
    Result verifyNewCode(String phone,String code);

}
